<!DOCTYPE html>
<html>
<head>
    <title></title>
		<#include "/header.html">
    <!--&lt;!&ndash; 引入样式 &ndash;&gt;-->
    <!--<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">-->
    <!--&lt;!&ndash; 引入组件库 &ndash;&gt;-->
    <!--<script src="https://unpkg.com/element-ui/lib/index.js"></script>-->


    <link rel="stylesheet" href="${request.contextPath}/statics/css/bootstrap-table.min.css">
    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.css">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/element.css">
    <script src="${request.contextPath}/statics/libs/element-ui/index.js"></script>
    <script src="${request.contextPath}/statics/libs/bootstrap-table.min.js"></script>

    <script src="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.min.js"></script>
    <script src="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.bootstrap3.js"></script>
    <script src="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.extension.js"></script>
    <script src="${request.contextPath}/statics/plugins/treegrid/tree.table.js"></script>
    <script>
        var i=0;
        function  hideInput() {
            var input = document.getElementsByClassName("el-upload--picture-card")[0]
            i=i+1;
            if(i==1){
                input.classList.add("hideInput");
            }
        }
    </script>
    <style>
        .hideInput{
            display: none;
        }
        .el-upload--picture-card>input{
            display: none;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList==0">
        <div class="grid-btn">
            <a class="btn btn-primary" @click="addMenu"><i class="fa fa-plus"></i>&nbsp;新增目录</a>
            <a class="btn btn-primary" @click="addFile"><i class="fa fa-plus"></i>&nbsp;新增文件</a>
            <!--<a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>-->
            <!--<a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>-->
        </div>
        <table id="table" data-mobile-responsive="true" data-click-to-select="true">
            <thead>
            <tr>
                <th data-field="selectItem" data-checkbox="true"></th>
            </tr>
            </thead>
        </table>
    </div>

    <div v-show="showList==1" class="panel panel-default">
        <div class="panel-heading">新增目录</div>
        <form class="form-horizontal">
				<div class="form-group">
                        <div class="col-sm-2 control-label">名称</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="myFile.name" placeholder=""/>
                        </div>
                    </div>
				<div class="form-group">
                        <div class="col-sm-2 control-label">上级目录</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" style="cursor:pointer;" v-model="myFile.parentName" @click="menuTree" readonly="readonly" placeholder="一级菜单"/>
                        </div>
                    </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>

    <div v-show="showList==2" class="panel panel-default">
        <div class="panel-heading">新增文件</div>
        <form class="form-horizontal">
          <div class="form-group">
                <div class="col-sm-2 control-label">上级目录</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" style="cursor:pointer;" v-model="myFile.parentName" @click="menuTree" readonly="readonly" placeholder="一级菜单"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">文件</div>
                <div class="col-sm-10">
                    <el-upload
                            action= "../../myCourse/myfile/upload"
                            :data="myFile"
                            list-type="picture-card"
                            ref="upload"
                            :on-success="uploadSuccess"
                            :on-remove="handleRemove"
                            limit="5"
                    >
                        <!--<el-button style="margin-left: 10px;" size="small" type="success" @click="clearFiles"  style="display:none;"   >清空专用</el-button>-->
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <!--<input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>-->
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>

</div>

<!-- 选择菜单 -->
<div id="menuLayer" style="display: none;padding:10px;">
    <ul id="menuTree" class="ztree"></ul>
</div>


<script src="${request.contextPath}/statics/js/modules/myCourse/myfile.js?_${.now?long}"></script>
</body>
</html>